FROM ccr.ccs.tencentyun.com/pybase/py39a:1.2
#FROM python:3.8-slim  # 如果拉不到ccr.ccs.tencentyun.com/pybase/py39a镜像，可以用这个

WORKDIR /root/app
COPY . /root/app

VOLUME /root/app

# py39a这个镜像集成了下面两个RUN命令，也就是不再需要设置源、下载gcc、net-tools、vim、uwsgi这些工具
# 用 python:3.8-slim镜像时，需要打开下面的注释
#RUN sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list && \
#    sed -i s@/deb.debian.org/@/mirrors.aliyun.com/@g /etc/apt/sources.list && \
#    sed -i s@/security.debian.org/@/mirrors.aliyun.com/@g /etc/apt/sources.list && \
#    apt-get update && \
#    apt-get install -y gcc net-tools vim && \
#    apt-get clean && \
#    rm -rf /var/lib/apt/lists/*
#
#RUN pip3 install uwsgi -i https://pypi.douban.com/simple --trusted-host pypi.douban.com

# 安装依赖
RUN pip3 install -r /root/app/requirements.txt -i https://pypi.douban.com/simple --trusted-host pypi.douban.com

EXPOSE 5000
